package com.xr.service.product;

import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.SqlDataset;
import com.bstek.dorado.common.*;
import com.xr.common.DBTools;
import com.xr.common.Tools;
import com.xr.system.User;

/**
 * select_product_insurertype_datasetProductListener
 */
public class select_product_insurertype_datasetProductListener extends AbstractDatasetListener {
	public boolean beforeLoadData(Dataset dataset) throws Exception { 
        
		  DoradoContext context = DoradoContext.getContext();
		  SqlDataset ds=(SqlDataset)dataset;
	      
		  //User user=(User)context.getAttribute(context.SESSION,"User");
		  //String pvdEmpId=user.getEmployeeId();
		  
		  String sql="";
	           
		  sql = "select t.product_id,t.product_name from pb_product t "
			  +"where t.product_id not in (select it.product_id from cs_insurer_type it where it.is_valid=1) "
			  +"and t.is_enabled=1 and t.if_virtual=0 "
			  +"and t.product_type_id=1700";
			  
		  sql+=" ORDER BY t.product_id";
		  //System.out.println(sql);
		  ds.setSql(sql);
	      return true;
	  }
}
